$("document").ready(function(){
    init();

});

function init(){

    var path = location.href;
    var id = path.substring(path.lastIndexOf("/")+1)

    $.ajax({
        url: "/order/findById/" + id,
        type: 'GET',
        data: {},
        dataType: "JSON",
        async: false,
        success: function (res) {
            if (res.code === "200") {
                var data = res.data;
                $("#orderId").val(data.orderId);
                $("#createtime").val(data.createtime);
                $("#userName").val(data.userName);
                $("#address").val(data.address);
                $("#phone").val(data.phone);
                $("#totalprice").val(data.totalprice);
                $("#status").val(data.status);
                $("#details").val(data.details);
            } else {
                alert(res.msg)
            }
        },
        error: function (e) {
            alert('发生错误')
        }

    })


}